import request from '@/utils/request'

export default {
  //修改用户昵称
  updateNickname(userId, newName) {
    return request({
      url: `/educenter/ucenter/updateNickname/${userId}/${newName}`,
      method: 'post'
    })
  },

  //修改用户头像
  updateAvatar(updateAvatarVo) {
    return request({
      url: `/educenter/ucenter/updateAvatar/`,
      method: 'post',
      data: updateAvatarVo
    })
  },

  //修改用户密码
  updatePassword(userId, newPassword) {
    return request({
      url: `/educenter/ucenter/updatePassword/${userId}/${newPassword}`,
      method: 'post'
    })
  },

  //修改手机号码
  updateMobile(userId, newMobile) {
    return request({
      url: `/educenter/ucenter/updateMobile/${userId}/${newMobile}`,
      method: 'post'
    })
  },

  //根据用户id分页展示所有文章
  userArticleList(userId, page, size) {
    return request({
      url: `/blogservice/m-blog/userArticleList/${userId}/${page}/${size}`,
      method: 'get'
    })
  },

  //根据用户id分页展示所有问题
  userQuestionList(userId, page, size) {
    return request({
      url: `/forumservice/forum-question/questionListByUserId/${userId}/${page}/${size}`,
      method: 'get'
    })
  },

}